package harima.agameditor.common.ui;

import java.awt.event.ActionListener;
import java.util.ArrayList;

import javax.swing.JButton;
import javax.swing.JPanel;

public class ButtonPanel<C> extends BaseEditorPanel<C>{
	
	protected ArrayList<JButton> allButtons;
	
	public ButtonPanel()
	{
		allButtons  = new ArrayList<JButton>();
	}
	
	protected JButton addButton(String actionCommand)
	{
		JButton button = new JButton();
		button.setActionCommand(actionCommand);
		allButtons.add(button);
		add(button);
		return button;
	}
	
	protected void addActionListener(ActionListener al)
	{
		for(JButton button: allButtons)
		{
			button.addActionListener(al);
		}
	}
}
